package cn.lzx.industry.processor;

import cn.lzx.industry.material.Pig;
import cn.lzx.industry.material.Project;
import lombok.extern.slf4j.Slf4j;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * Created by lizhenxing on 2018/2/2.
 */
@Aspect
@Order(3)
@Slf4j
@Component
public class ProcessorC {

    //标价
    @Around(value = "cn.lzx.industry.assist.ProcessorAssist.pointPigExe(pig)")
    public Object markPrice(ProceedingJoinPoint joinPoint, Pig pig) throws Throwable {
        pig.setMarkPrice(10);
        log.info("执行标价操作,{}", pig);
        return joinPoint.proceed(new Object[]{pig});
    }

    @Around(value = "cn.lzx.industry.assist.ProcessorAssist.pointProject(project)")
    public Object setTester(ProceedingJoinPoint joinPoint, Project project) throws Throwable {
        project.setTester("张然");
        log.info("选出tester,{}", project);
        return joinPoint.proceed(new Object[]{project});
    }
}
